cmake_minimum_required(VERSION 2.8)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeUtils/")

IF(MISSING_MODULES)
  MESSAGE(FATAL_ERROR "Could not generate all makefiles: missing modules: ${MISSING_MODULES}")
ENDIF(MISSING_MODULES)

set(Boost_USE_STATIC_LIBS   ON)
find_package(Boost COMPONENTS unit_test_framework REQUIRED)
MESSAGE(STATUS "Boost_test found? ${Boost_FOUND}")
IF(Boost_FOUND)
	MESSAGE(STATUS "Boost_test include: ${Boost_INCLUDE_DIRS}")
	MESSAGE(STATUS "Boost_test libs: ${Boost_LIBRARIES}")
	MESSAGE(STATUS "Boost_test debug libs: ${Boost_LIBRARIES}")
	link_directories(${Boost_LIBRARY_DIRS})
ELSE(Boost_FOUND)
	SET(MISSING_MODULES ${MISSING_MODULES} "Boost_tests")
ENDIF(Boost_FOUND)

# Add some global infos for compiling
if(WIN32)
	
else(WIN32)
	ADD_DEFINITIONS(-Wall -W -ansi ) #More warnings/errors
	ADD_DEFINITIONS(-Wno-long-long -Wno-comments) #Ok, remove some
	ADD_DEFINITIONS(-g) # Compile in debug mode
endif(WIN32)

add_subdirectory (Raytracer) 
if(WIN32)
add_subdirectory (RaytracerWin32)
endif()
add_subdirectory (RaytracerApp)
add_subdirectory (Image)
add_subdirectory (Math)
add_subdirectory (Objects)
add_subdirectory (Tests)
